Skip to content

optimize some operator#132

Merged
diegoholiveira merged 1 commit intomainfrom
optimize-some
Dec 18, 2025
Merged

optimize some operator#132
diegoholiveira merged 1 commit intomainfrom
optimize-some

Conversation

@diegoholiveira
Copy link
Copy Markdown
Owner

Eliminate N-1 redundant calls to solveVars() where N is the array length. Benchmark results show significant improvements across all array sizes:

Execution Time

  • Small arrays (10 elements): -23.47% (9.3µs → 7.1µs)
  • Medium arrays (100 elements): -31.80% (75.2µs → 51.3µs)
  • Large arrays (1000 elements): -31.24% (398.8µs → 274.2µs)

Memory Usage

  • Small arrays: -32.80% (19.5 KiB → 13.1 KiB)
  • Medium arrays: -44.24% (159.2 KiB → 88.8 KiB)
  • Large arrays: -43.61% (815.5 KiB → 459.8 KiB)

Allocations

  • Small arrays: -24.11% (224 → 170 allocs/op)
  • Medium arrays: -32.16% (1847 → 1253 allocs/op)
  • Large arrays: -29.79% (10069 → 7069 allocs/op)

How to reproduce:

$ cd benchmark && ./bench v3.8.7 BenchmarkArrayOperationsScaling

@diegoholiveira diegoholiveira self-assigned this Dec 18, 2025
@diegoholiveira diegoholiveira merged commit d8286ab into main Dec 18, 2025
14 checks passed
@diegoholiveira diegoholiveira deleted the optimize-some branch December 18, 2025 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant